.class public Lcom/htc/android/footprints/utils/TitleGenerator;
.super Ljava/lang/Object;
.source "TitleGenerator.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;
    }
.end annotation


# static fields
.field private static final TAG:Ljava/lang/String; = "TitleGenerator"

.field public static final USE_ADMIN_AS_CITY:I = 0x1

.field public static final USE_LOCALITY_AS_CITY:I = 0x2

.field private static mAddressLine:Ljava/lang/String;

.field private static mInstance:Lcom/htc/android/footprints/utils/TitleGenerator;

.field private static mTitle:Ljava/lang/String;

.field private static searchThread:Ljava/lang/Thread;

.field private static stopSearch:Z


# instance fields
.field private mAddress:Landroid/location/Address;

.field private mContext:Landroid/content/Context;

.field private mListener:Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;

.field private mMCCTable:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/Integer;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field mMccCodeTable:[I

.field private mTargetLocation:Landroid/location/Location;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 27
    const/4 v0, 0x0

    sput-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mInstance:Lcom/htc/android/footprints/utils/TitleGenerator;

    .line 28
    new-instance v0, Ljava/lang/String;

    invoke-direct {v0}, Ljava/lang/String;-><init>()V

    sput-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTitle:Ljava/lang/String;

    .line 29
    new-instance v0, Ljava/lang/String;

    invoke-direct {v0}, Ljava/lang/String;-><init>()V

    sput-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddressLine:Ljava/lang/String;

    .line 30
    const/4 v0, 0x0

    sput-boolean v0, Lcom/htc/android/footprints/utils/TitleGenerator;->stopSearch:Z

    return-void
.end method

.method private constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 57
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 32
    iput-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    .line 33
    iput-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTargetLocation:Landroid/location/Location;

    .line 35
    iput-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mListener:Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;

    .line 277
    const/16 v0, 0xe8

    new-array v0, v0, [I

    fill-array-data v0, :array_0

    iput-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mMccCodeTable:[I

    .line 58
    return-void

    .line 277
    :array_0
    .array-data 0x4
        0x9ct 0x1t 0x0t 0x0t
        0x14t 0x1t 0x0t 0x0t
        0x5bt 0x2t 0x0t 0x0t
        0x20t 0x2t 0x0t 0x0t
        0xd5t 0x0t 0x0t 0x0t
        0x77t 0x2t 0x0t 0x0t
        0x6dt 0x1t 0x0t 0x0t
        0x58t 0x1t 0x0t 0x0t
        0xd2t 0x2t 0x0t 0x0t
        0x1bt 0x1t 0x0t 0x0t
        0x6bt 0x1t 0x0t 0x0t
        0xf9t 0x1t 0x0t 0x0t
        0xe8t 0x0t 0x0t 0x0t
        0x90t 0x1t 0x0t 0x0t
        0x6ct 0x1t 0x0t 0x0t
        0xaat 0x1t 0x0t 0x0t
        0xd6t 0x1t 0x0t 0x0t
        0x56t 0x1t 0x0t 0x0t
        0x1t 0x1t 0x0t 0x0t
        0xcet 0x0t 0x0t 0x0t
        0xbet 0x2t 0x0t 0x0t
        0x68t 0x2t 0x0t 0x0t
        0x5et 0x1t 0x0t 0x0t
        0x92t 0x1t 0x0t 0x0t
        0xe0t 0x2t 0x0t 0x0t
        0xdat 0x0t 0x0t 0x0t
        0x8ct 0x2t 0x0t 0x0t
        0xd4t 0x2t 0x0t 0x0t
        0x5ct 0x1t 0x0t 0x0t
        0x10t 0x2t 0x0t 0x0t
        0x1ct 0x1t 0x0t 0x0t
        0x65t 0x2t 0x0t 0x0t
        0x82t 0x2t 0x0t 0x0t
        0xc8t 0x1t 0x0t 0x0t
        0x70t 0x2t 0x0t 0x0t
        0x2et 0x1t 0x0t 0x0t
        0x71t 0x2t 0x0t 0x0t
        0x5at 0x1t 0x0t 0x0t
        0x6ft 0x2t 0x0t 0x0t
        0x6et 0x2t 0x0t 0x0t
        0xdat 0x2t 0x0t 0x0t
        0xcct 0x1t 0x0t 0x0t
        0xdct 0x2t 0x0t 0x0t
        0x8et 0x2t 0x0t 0x0t
        0x75t 0x2t 0x0t 0x0t
        0x24t 0x2t 0x0t 0x0t
        0xc8t 0x2t 0x0t 0x0t
        0x64t 0x2t 0x0t 0x0t
        0xdbt 0x0t 0x0t 0x0t
        0x70t 0x1t 0x0t 0x0t
        0x18t 0x1t 0x0t 0x0t
        0xe6t 0x0t 0x0t 0x0t
        0x76t 0x2t 0x0t 0x0t
        0xeet 0x0t 0x0t 0x0t
        0x7et 0x2t 0x0t 0x0t
        0x6et 0x1t 0x0t 0x0t
        0x72t 0x1t 0x0t 0x0t
        0x2t 0x2t 0x0t 0x0t
        0xe4t 0x2t 0x0t 0x0t
        0x5at 0x2t 0x0t 0x0t
        0xc2t 0x2t 0x0t 0x0t
        0x73t 0x2t 0x0t 0x0t
        0x91t 0x2t 0x0t 0x0t
        0xf8t 0x0t 0x0t 0x0t
        0x7ct 0x2t 0x0t 0x0t
        0x20t 0x1t 0x0t 0x0t
        0x1et 0x2t 0x0t 0x0t
        0xf4t 0x0t 0x0t 0x0t
        0xd0t 0x0t 0x0t 0x0t
        0xe6t 0x2t 0x0t 0x0t
        0x23t 0x2t 0x0t 0x0t
        0x74t 0x2t 0x0t 0x0t
        0x5ft 0x2t 0x0t 0x0t
        0x1at 0x1t 0x0t 0x0t
        0x6t 0x1t 0x0t 0x0t
        0x6ct 0x2t 0x0t 0x0t
        0xat 0x1t 0x0t 0x0t
        0xcat 0x0t 0x0t 0x0t
        0x22t 0x1t 0x0t 0x0t
        0x60t 0x1t 0x0t 0x0t
        0x54t 0x1t 0x0t 0x0t
        0x17t 0x2t 0x0t 0x0t
        0xc0t 0x2t 0x0t 0x0t
        0x63t 0x2t 0x0t 0x0t
        0x78t 0x2t 0x0t 0x0t
        0xe2t 0x2t 0x0t 0x0t
        0x74t 0x1t 0x0t 0x0t
        0xc4t 0x2t 0x0t 0x0t
        0xc6t 0x1t 0x0t 0x0t
        0xd8t 0x0t 0x0t 0x0t
        0x12t 0x1t 0x0t 0x0t
        0x94t 0x1t 0x0t 0x0t
        0x95t 0x1t 0x0t 0x0t
        0xfet 0x1t 0x0t 0x0t
        0xb0t 0x1t 0x0t 0x0t
        0xa2t 0x1t 0x0t 0x0t
        0x10t 0x1t 0x0t 0x0t
        0xa9t 0x1t 0x0t 0x0t
        0xdet 0x0t 0x0t 0x0t
        0x52t 0x1t 0x0t 0x0t
        0xb9t 0x1t 0x0t 0x0t
        0xb8t 0x1t 0x0t 0x0t
        0xa0t 0x1t 0x0t 0x0t
        0x91t 0x1t 0x0t 0x0t
        0x7ft 0x2t 0x0t 0x0t
        0x21t 0x2t 0x0t 0x0t
        0xd3t 0x1t 0x0t 0x0t
        0xc2t 0x1t 0x0t 0x0t
        0xa3t 0x1t 0x0t 0x0t
        0xb5t 0x1t 0x0t 0x0t
        0xc9t 0x1t 0x0t 0x0t
        0xf7t 0x0t 0x0t 0x0t
        0x9ft 0x1t 0x0t 0x0t
        0x8bt 0x2t 0x0t 0x0t
        0x6at 0x2t 0x0t 0x0t
        0x5et 0x2t 0x0t 0x0t
        0x27t 0x1t 0x0t 0x0t
        0xf6t 0x0t 0x0t 0x0t
        0xet 0x1t 0x0t 0x0t
        0xc7t 0x1t 0x0t 0x0t
        0x26t 0x1t 0x0t 0x0t
        0x86t 0x2t 0x0t 0x0t
        0x8at 0x2t 0x0t 0x0t
        0xf6t 0x1t 0x0t 0x0t
        0xd8t 0x1t 0x0t 0x0t
        0x62t 0x2t 0x0t 0x0t
        0x16t 0x1t 0x0t 0x0t
        0x27t 0x2t 0x0t 0x0t
        0x54t 0x1t 0x0t 0x0t
        0x61t 0x2t 0x0t 0x0t
        0x69t 0x2t 0x0t 0x0t
        0x4et 0x1t 0x0t 0x0t
        0x26t 0x2t 0x0t 0x0t
        0x3t 0x1t 0x0t 0x0t
        0xd4t 0x0t 0x0t 0x0t
        0xact 0x1t 0x0t 0x0t
        0x29t 0x1t 0x0t 0x0t
        0x62t 0x1t 0x0t 0x0t
        0x5ct 0x2t 0x0t 0x0t
        0x83t 0x2t 0x0t 0x0t
        0x9et 0x1t 0x0t 0x0t
        0x89t 0x2t 0x0t 0x0t
        0x18t 0x2t 0x0t 0x0t
        0xadt 0x1t 0x0t 0x0t
        0xcct 0x0t 0x0t 0x0t
        0x6at 0x1t 0x0t 0x0t
        0x22t 0x2t 0x0t 0x0t
        0x12t 0x2t 0x0t 0x0t
        0xc6t 0x2t 0x0t 0x0t
        0x66t 0x2t 0x0t 0x0t
        0x6dt 0x2t 0x0t 0x0t
        0x16t 0x2t 0x0t 0x0t
        0xf2t 0x0t 0x0t 0x0t
        0xa6t 0x1t 0x0t 0x0t
        0x9at 0x1t 0x0t 0x0t
        0x28t 0x2t 0x0t 0x0t
        0xa7t 0x1t 0x0t 0x0t
        0xcat 0x2t 0x0t 0x0t
        0x19t 0x2t 0x0t 0x0t
        0xe8t 0x2t 0x0t 0x0t
        0xcct 0x2t 0x0t 0x0t
        0x3t 0x2t 0x0t 0x0t
        0x4t 0x1t 0x0t 0x0t
        0xct 0x1t 0x0t 0x0t
        0x4at 0x1t 0x0t 0x0t
        0xabt 0x1t 0x0t 0x0t
        0x87t 0x2t 0x0t 0x0t
        0xe2t 0x0t 0x0t 0x0t
        0xfat 0x0t 0x0t 0x0t
        0x7bt 0x2t 0x0t 0x0t
        0x64t 0x1t 0x0t 0x0t
        0x66t 0x1t 0x0t 0x0t
        0x34t 0x1t 0x0t 0x0t
        0x68t 0x1t 0x0t 0x0t
        0x25t 0x2t 0x0t 0x0t
        0x24t 0x1t 0x0t 0x0t
        0x72t 0x2t 0x0t 0x0t
        0xa4t 0x1t 0x0t 0x0t
        0x60t 0x2t 0x0t 0x0t
        0xdct 0x0t 0x0t 0x0t
        0x79t 0x2t 0x0t 0x0t
        0x6bt 0x2t 0x0t 0x0t
        0xdt 0x2t 0x0t 0x0t
        0xe7t 0x0t 0x0t 0x0t
        0x25t 0x1t 0x0t 0x0t
        0x1ct 0x2t 0x0t 0x0t
        0x7dt 0x2t 0x0t 0x0t
        0x8ft 0x2t 0x0t 0x0t
        0xd6t 0x0t 0x0t 0x0t
        0x9dt 0x1t 0x0t 0x0t
        0x7at 0x2t 0x0t 0x0t
        0xeat 0x2t 0x0t 0x0t
        0x8dt 0x2t 0x0t 0x0t
        0xf0t 0x0t 0x0t 0x0t
        0xe4t 0x0t 0x0t 0x0t
        0xa1t 0x1t 0x0t 0x0t
        0xd2t 0x1t 0x0t 0x0t
        0xb4t 0x1t 0x0t 0x0t
        0x80t 0x2t 0x0t 0x0t
        0x8t 0x2t 0x0t 0x0t
        0x67t 0x2t 0x0t 0x0t
        0x1bt 0x2t 0x0t 0x0t
        0x76t 0x1t 0x0t 0x0t
        0x5dt 0x2t 0x0t 0x0t
        0x1et 0x1t 0x0t 0x0t
        0xb6t 0x1t 0x0t 0x0t
        0x78t 0x1t 0x0t 0x0t
        0x81t 0x2t 0x0t 0x0t
        0xfft 0x0t 0x0t 0x0t
        0xa8t 0x1t 0x0t 0x0t
        0xaet 0x1t 0x0t 0x0t
        0xaft 0x1t 0x0t 0x0t
        0xebt 0x0t 0x0t 0x0t
        0xeat 0x0t 0x0t 0x0t
        0x36t 0x1t 0x0t 0x0t
        0x37t 0x1t 0x0t 0x0t
        0x38t 0x1t 0x0t 0x0t
        0x39t 0x1t 0x0t 0x0t
        0x3at 0x1t 0x0t 0x0t
        0x3bt 0x1t 0x0t 0x0t
        0x3ct 0x1t 0x0t 0x0t
        0x4ct 0x1t 0x0t 0x0t
        0xect 0x2t 0x0t 0x0t
        0xb2t 0x1t 0x0t 0x0t
        0x1dt 0x2t 0x0t 0x0t
        0xe1t 0x0t 0x0t 0x0t
        0xdet 0x2t 0x0t 0x0t
        0xc4t 0x1t 0x0t 0x0t
        0x1ft 0x2t 0x0t 0x0t
        0xa5t 0x1t 0x0t 0x0t
        0x85t 0x2t 0x0t 0x0t
        0x88t 0x2t 0x0t 0x0t
    .end array-data
.end method

.method static synthetic access$000()Z
    .locals 1

    .prologue
    .line 24
    sget-boolean v0, Lcom/htc/android/footprints/utils/TitleGenerator;->stopSearch:Z

    return v0
.end method

.method static synthetic access$002(Z)Z
    .locals 0
    .parameter "x0"

    .prologue
    .line 24
    sput-boolean p0, Lcom/htc/android/footprints/utils/TitleGenerator;->stopSearch:Z

    return p0
.end method

.method static synthetic access$100(Lcom/htc/android/footprints/utils/TitleGenerator;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 24
    invoke-direct {p0}, Lcom/htc/android/footprints/utils/TitleGenerator;->startGeocoding()Z

    move-result v0

    return v0
.end method

.method static synthetic access$200(Lcom/htc/android/footprints/utils/TitleGenerator;)Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;
    .locals 1
    .parameter "x0"

    .prologue
    .line 24
    iget-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mListener:Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;

    return-object v0
.end method

.method static synthetic access$300(Lcom/htc/android/footprints/utils/TitleGenerator;)Landroid/location/Location;
    .locals 1
    .parameter "x0"

    .prologue
    .line 24
    iget-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTargetLocation:Landroid/location/Location;

    return-object v0
.end method

.method static synthetic access$400()Ljava/lang/String;
    .locals 1

    .prologue
    .line 24
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTitle:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$500()Ljava/lang/String;
    .locals 1

    .prologue
    .line 24
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddressLine:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$600(Lcom/htc/android/footprints/utils/TitleGenerator;)Landroid/location/Address;
    .locals 1
    .parameter "x0"

    .prologue
    .line 24
    iget-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddress:Landroid/location/Address;

    return-object v0
.end method

.method private composeAddressLine(Landroid/location/Address;)Ljava/lang/String;
    .locals 5
    .parameter "address"

    .prologue
    .line 182
    invoke-virtual {p1}, Landroid/location/Address;->getMaxAddressLineIndex()I

    move-result v2

    .line 183
    .local v2, maxAddressLineNum:I
    const-string v0, ""

    .line 185
    .local v0, addressLine:Ljava/lang/String;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-gt v1, v2, :cond_1

    .line 186
    if-lez v1, :cond_0

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ", "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1, v1}, Landroid/location/Address;->getAddressLine(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 185
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 187
    :cond_0
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1, v1}, Landroid/location/Address;->getAddressLine(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_1

    .line 190
    :cond_1
    return-object v0
.end method

.method private getCitySource(Landroid/location/Address;)I
    .locals 6
    .parameter "address"

    .prologue
    .line 259
    invoke-virtual {p1}, Landroid/location/Address;->getMaxAddressLineIndex()I

    move-result v2

    .line 260
    .local v2, maxAddressLineNum:I
    const-string v0, ""

    .line 262
    .local v0, addressLine:Ljava/lang/String;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-gt v1, v2, :cond_0

    .line 263
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1, v1}, Landroid/location/Address;->getAddressLine(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ", "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 262
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 266
    :cond_0
    const-string v3, "TitleGenerator"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "address line: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 268
    invoke-direct {p0, v0}, Lcom/htc/android/footprints/utils/TitleGenerator;->isAddressLineContainTaiwan(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 269
    const/4 v3, 0x1

    .line 271
    :goto_1
    return v3

    :cond_1
    const/4 v3, 0x2

    goto :goto_1
.end method

.method public static getInstance(Landroid/content/Context;)Lcom/htc/android/footprints/utils/TitleGenerator;
    .locals 2
    .parameter "context"

    .prologue
    .line 49
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mInstance:Lcom/htc/android/footprints/utils/TitleGenerator;

    if-nez v0, :cond_0

    .line 50
    new-instance v0, Lcom/htc/android/footprints/utils/TitleGenerator;

    invoke-direct {v0}, Lcom/htc/android/footprints/utils/TitleGenerator;-><init>()V

    sput-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mInstance:Lcom/htc/android/footprints/utils/TitleGenerator;

    .line 51
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mInstance:Lcom/htc/android/footprints/utils/TitleGenerator;

    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    iput-object v1, v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    .line 52
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mInstance:Lcom/htc/android/footprints/utils/TitleGenerator;

    invoke-direct {v0}, Lcom/htc/android/footprints/utils/TitleGenerator;->init()V

    .line 54
    :cond_0
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mInstance:Lcom/htc/android/footprints/utils/TitleGenerator;

    return-object v0
.end method

.method private init()V
    .locals 1

    .prologue
    .line 61
    iget-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    if-nez v0, :cond_0

    .line 65
    :goto_0
    return-void

    .line 64
    :cond_0
    invoke-virtual {p0}, Lcom/htc/android/footprints/utils/TitleGenerator;->loadMccTable()V

    goto :goto_0
.end method

.method private isAddressLineContainJapan(Ljava/lang/String;)Z
    .locals 2
    .parameter "addressLine"

    .prologue
    const-string v1, "\u65e5\u672c"

    .line 246
    const-string v0, "Japan"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "\u65e5\u672c"

    invoke-virtual {p1, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "\u65e5\u672c"

    invoke-virtual {p1, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Japonsko"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Jap\u00f3n"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Japon"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Giappone"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Japonia"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "\u042f\u043f\u043e\u043d\u0438\u044f"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-lez v0, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private isAddressLineContainTaiwan(Ljava/lang/String;)Z
    .locals 1
    .parameter "addressLine"

    .prologue
    .line 233
    const-string v0, "Taiwan"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "\u53f0\u7063"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "\u53f0\u6e7e"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Tchaj-wan"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Taiw\u00e1n"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Ta\u00efwan"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "Tajwan"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-gtz v0, :cond_0

    const-string v0, "\u0422\u0430\u0439\u0432\u0430\u043d\u044c"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    if-lez v0, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private isNetworkEnable()Z
    .locals 7

    .prologue
    .line 97
    iget-object v5, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    if-nez v5, :cond_0

    .line 98
    const/4 v5, 0x0

    .line 118
    :goto_0
    return v5

    .line 100
    :cond_0
    const/4 v1, 0x0

    .line 103
    .local v1, result:Z
    iget-object v5, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    const-string v6, "wifi"

    invoke-virtual {v5, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/net/wifi/WifiManager;

    .line 105
    .local v4, wifiManager:Landroid/net/wifi/WifiManager;
    invoke-virtual {v4}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;

    move-result-object v3

    .line 106
    .local v3, wifiInfo:Landroid/net/wifi/WifiInfo;
    invoke-virtual {v3}, Landroid/net/wifi/WifiInfo;->getSupplicantState()Landroid/net/wifi/SupplicantState;

    move-result-object v5

    sget-object v6, Landroid/net/wifi/SupplicantState;->COMPLETED:Landroid/net/wifi/SupplicantState;

    if-ne v5, v6, :cond_1

    .line 107
    const/4 v1, 0x1

    .line 111
    :cond_1
    iget-object v5, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    const-string v6, "phone"

    invoke-virtual {v5, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/telephony/TelephonyManager;

    .line 113
    .local v2, telephony:Landroid/telephony/TelephonyManager;
    invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getDataState()I

    move-result v0

    .line 114
    .local v0, dataState:I
    const/4 v5, 0x2

    if-ne v0, v5, :cond_2

    .line 115
    const/4 v1, 0x1

    :cond_2
    move v5, v1

    .line 118
    goto :goto_0
.end method

.method private searchFromGgeocoder()V
    .locals 2

    .prologue
    .line 138
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/htc/android/footprints/utils/TitleGenerator$1;

    invoke-direct {v1, p0}, Lcom/htc/android/footprints/utils/TitleGenerator$1;-><init>(Lcom/htc/android/footprints/utils/TitleGenerator;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    sput-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->searchThread:Ljava/lang/Thread;

    .line 177
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->searchThread:Ljava/lang/Thread;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Ljava/lang/Thread;->setPriority(I)V

    .line 178
    sget-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->searchThread:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 179
    return-void
.end method

.method private declared-synchronized startGeocoding()Z
    .locals 9

    .prologue
    .line 194
    monitor-enter p0

    const/4 v8, 0x0

    .line 196
    .local v8, result:Z
    :try_start_0
    new-instance v0, Landroid/location/Geocoder;

    iget-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/location/Geocoder;-><init>(Landroid/content/Context;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 199
    .local v0, geoCoder:Landroid/location/Geocoder;
    :try_start_1
    iget-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTargetLocation:Landroid/location/Location;

    invoke-virtual {v1}, Landroid/location/Location;->getLatitude()D

    move-result-wide v1

    iget-object v3, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTargetLocation:Landroid/location/Location;

    invoke-virtual {v3}, Landroid/location/Location;->getLongitude()D

    move-result-wide v3

    const/4 v5, 0x1

    invoke-virtual/range {v0 .. v5}, Landroid/location/Geocoder;->getFromLocation(DDI)Ljava/util/List;

    move-result-object v7

    .line 202
    .local v7, list:Ljava/util/List;,"Ljava/util/List<Landroid/location/Address;>;"
    if-eqz v7, :cond_0

    invoke-interface {v7}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_0

    .line 203
    const/4 v1, 0x0

    invoke-interface {v7, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/location/Address;

    iput-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddress:Landroid/location/Address;

    .line 206
    iget-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddress:Landroid/location/Address;

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/utils/TitleGenerator;->getCitySource(Landroid/location/Address;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    move-result v1

    packed-switch v1, :pswitch_data_0

    .line 229
    .end local v7           #list:Ljava/util/List;,"Ljava/util/List<Landroid/location/Address;>;"
    :cond_0
    :goto_0
    monitor-exit p0

    return v8

    .line 208
    .restart local v7       #list:Ljava/util/List;,"Ljava/util/List<Landroid/location/Address;>;"
    :pswitch_0
    :try_start_2
    sget-object v1, Lcom/htc/android/footprints/utils/TitleGenerator;->mTitle:Ljava/lang/String;

    if-eqz v1, :cond_0

    .line 209
    iget-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddress:Landroid/location/Address;

    invoke-virtual {v1}, Landroid/location/Address;->getAdminArea()Ljava/lang/String;

    move-result-object v1

    sput-object v1, Lcom/htc/android/footprints/utils/TitleGenerator;->mTitle:Ljava/lang/String;

    .line 211
    iget-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddress:Landroid/location/Address;

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/utils/TitleGenerator;->composeAddressLine(Landroid/location/Address;)Ljava/lang/String;

    move-result-object v1

    sput-object v1, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddressLine:Ljava/lang/String;

    .line 212
    const/4 v8, 0x1

    goto :goto_0

    .line 216
    :pswitch_1
    sget-object v1, Lcom/htc/android/footprints/utils/TitleGenerator;->mTitle:Ljava/lang/String;

    if-eqz v1, :cond_0

    .line 217
    iget-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddress:Landroid/location/Address;

    invoke-virtual {v1}, Landroid/location/Address;->getLocality()Ljava/lang/String;

    move-result-object v1

    sput-object v1, Lcom/htc/android/footprints/utils/TitleGenerator;->mTitle:Ljava/lang/String;

    .line 219
    iget-object v1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddress:Landroid/location/Address;

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/utils/TitleGenerator;->composeAddressLine(Landroid/location/Address;)Ljava/lang/String;

    move-result-object v1

    sput-object v1, Lcom/htc/android/footprints/utils/TitleGenerator;->mAddressLine:Ljava/lang/String;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    .line 220
    const/4 v8, 0x1

    goto :goto_0

    .line 225
    .end local v7           #list:Ljava/util/List;,"Ljava/util/List<Landroid/location/Address;>;"
    :catch_0
    move-exception v1

    move-object v6, v1

    .line 226
    .local v6, e:Ljava/io/IOException;
    :try_start_3
    invoke-virtual {v6}, Ljava/io/IOException;->printStackTrace()V

    .line 227
    const-string v1, "TitleGenerator"

    invoke-virtual {v6}, Ljava/io/IOException;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_0

    .line 194
    .end local v0           #geoCoder:Landroid/location/Geocoder;
    .end local v6           #e:Ljava/io/IOException;
    :catchall_0
    move-exception v1

    monitor-exit p0

    throw v1

    .line 206
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method


# virtual methods
.method public getTitleFromMccTable()Ljava/lang/String;
    .locals 6

    .prologue
    .line 78
    const/4 v3, 0x0

    .line 79
    .local v3, title:Ljava/lang/String;
    const/4 v1, 0x0

    .line 81
    .local v1, operator:Ljava/lang/String;
    iget-object v4, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    if-eqz v4, :cond_0

    .line 82
    iget-object v4, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    const-string v5, "phone"

    invoke-virtual {v4, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/telephony/TelephonyManager;

    .line 85
    .local v2, service:Landroid/telephony/TelephonyManager;
    invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v1

    .line 87
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v4

    if-lez v4, :cond_0

    .line 88
    const/4 v4, 0x0

    const/4 v5, 0x3

    invoke-virtual {v1, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    .line 89
    .local v0, code:I
    iget-object v4, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mMCCTable:Ljava/util/HashMap;

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    .end local v3           #title:Ljava/lang/String;
    check-cast v3, Ljava/lang/String;

    .line 93
    .end local v0           #code:I
    .end local v2           #service:Landroid/telephony/TelephonyManager;
    .restart local v3       #title:Ljava/lang/String;
    :cond_0
    return-object v3
.end method

.method public getTitleFromNetwork(Landroid/location/Location;Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;)V
    .locals 2
    .parameter "location"
    .parameter "listener"

    .prologue
    .line 127
    const-string v0, "TitleGenerator"

    const-string v1, "getTitleFromNetwork"

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 128
    const-string v0, ""

    sput-object v0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTitle:Ljava/lang/String;

    .line 129
    iput-object p1, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mTargetLocation:Landroid/location/Location;

    .line 130
    iput-object p2, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mListener:Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;

    .line 131
    const/4 v0, 0x0

    sput-boolean v0, Lcom/htc/android/footprints/utils/TitleGenerator;->stopSearch:Z

    .line 132
    iget-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/htc/android/footprints/utils/TitleGenerator;->isNetworkEnable()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 133
    invoke-direct {p0}, Lcom/htc/android/footprints/utils/TitleGenerator;->searchFromGgeocoder()V

    .line 135
    :cond_0
    return-void
.end method

.method public loadMccTable()V
    .locals 5

    .prologue
    .line 68
    new-instance v2, Ljava/util/HashMap;

    invoke-direct {v2}, Ljava/util/HashMap;-><init>()V

    iput-object v2, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mMCCTable:Ljava/util/HashMap;

    .line 69
    iget-object v2, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f070003

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getTextArray(I)[Ljava/lang/CharSequence;

    move-result-object v1

    .line 72
    .local v1, mItems:[Ljava/lang/CharSequence;
    const/4 v0, 0x0

    .local v0, idx:I
    :goto_0
    iget-object v2, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mMccCodeTable:[I

    array-length v2, v2

    if-ge v0, v2, :cond_0

    .line 73
    iget-object v2, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mMCCTable:Ljava/util/HashMap;

    iget-object v3, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mMccCodeTable:[I

    aget v3, v3, v0

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aget-object v4, v1, v0

    invoke-virtual {v4}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 72
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 75
    :cond_0
    return-void
.end method

.method public stopTitleSearch()V
    .locals 1

    .prologue
    .line 122
    const/4 v0, 0x1

    sput-boolean v0, Lcom/htc/android/footprints/utils/TitleGenerator;->stopSearch:Z

    .line 123
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/utils/TitleGenerator;->mListener:Lcom/htc/android/footprints/utils/TitleGenerator$SearchListener;

    .line 124
    return-void
.end method
